import HttpRequest from "@/utils/request";
import { IRows, ILog } from "./type";

// 查询列表
export function getLogs(params = {}) {
  return HttpRequest<IRows>("/log", "GET", params, {
    isLoading: true,
  });
}

// 查询某个
export function getLog(id: number) {
  return HttpRequest<ILog>("/log/" + id, "GET");
}

// 新增
export function addLog(params = {}) {
  return HttpRequest("/log", "POST", params);
}

// 删除
export function delLog(ids: number[] = []) {
  return HttpRequest("/log", "DELETE", { ids: ids.join() });
}

// 清空数据
export function clearLog() {
  return HttpRequest("/log/clear", "DELETE");
}
